package com.xuan.error;

public class error01 {
    public static void main(String[] args) {
//        new error01().a();
//        System.out.println(1/5);
//        捕获异常,假设要捕获多个异常，需要安装从小到大的顺序
try {//catch(想要捕获的数据类型)捕获异常
}catch (Error e){
    System.out.println(3/3);
    System.out.println("Error");
}catch (Exception e){
    System.out.println("Exception");
}catch (Throwable t){
    System.out.println("Throwable");
}
finally {//可以可无
    System.out.println("结束");
}
    }
    public void a(){
        b();
    }
    public void b(){
        a();
    }
}
